<template>
	<view>
	<cu-custom bgColor="bg-gradual-pink" :isBack="true">
		<block slot="backText" @click="goback()">返回</block>
		<block slot="content">功能菜单界面</block>
	</cu-custom>
	
	<view class="cu-bar bg-white  margin-top ">
		<view class="cu-item" >
			<button class="cu-btn  bg-white " @click="GoChangePasswordPage()" style="width: 100%;">
				<text class="cuIcon-myfill text-orange"></text>
				<text class="text-grey">修改用户密码</text>
			</button>
			
			
		</view>	
		
	</view>
	
	<view class="cu-bar bg-white solid-bottom margin-top">
		<view class="cu-item">
			<button class="cu-btn  bg-white " @click="GoAllExamPage()">
				<text class="cuIcon-discoverfill text-green"></text>
				<text class="text-grey">查看试题列表</text>
				</button>
		</view>	
	</view>
	<view class="cu-bar bg-white solid-bottom margin-top">
		<view class="cu-item">
			<button class="cu-btn  bg-white " @click="GOSubjectList()">
				<text class="cuIcon-discoverfill text-green"></text>
				<text class="text-grey">查看学科列表</text>
				</button>
		</view>	
	</view>
	
	
	
	<view class="cu-bar bg-white solid-bottom margin-top">
		<view class="cu-item">
			<button class="cu-btn  bg-white " @click="GoExamPage()">
				<text class="cuIcon-discoverfill text-red"></text>
				<text class="text-grey">随机抽取题目</text>
				</button>
		</view>	
	</view>
	
	<view class="cu-bar bg-white solid-bottom margin-top">
		<view class="cu-item">
			<button class="cu-btn  bg-white " @click="Exit()">
				<text class="cuIcon-exit text-red"></text>
				<text class="text-grey">退出登录</text>
				</button>
		</view>	
	</view>

	
	
	
	
	</view>

</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			goback(){
				console.log("回退")
				uni.navigateBack({
					delta:1
				})
			},
			GoChangePasswordPage(){
				console.log("前往修改用户信息")
				uni.navigateTo({
					url:"/pages/mypages/changepassword/changepassword"
				})
			},
			GoAllExamPage(){
				console.log("前往考试列表")
				uni.navigateTo({
					url:"/pages/mypages/allexam/allexam"
				})
			},
			GOSubjectList(){
				console.log("前往学科列表")
				uni.navigateTo({
					url:"/pages/mypages/SubjectList/SubjectList"
				})
			},
			GoExamPage(){
				console.log("前往考试界面")
				uni.navigateTo({
					url:"/pages/mypages/exampage/exampage"
				})
				
			},
			Exit(){
				uni.removeStorageSync('id');
				uni.switchTab({
					url:"/pages/mypages/login"
				})
				uni.showToast({
					title:"注销成功",
					icon:"none",
				})
			}
		},
		created(){
			//页面加载需要鉴定权限
			uni.getStorage({
			   key: 'id',
			   success: function (res) {
			      
			       
			   },
					fail:function(){
						console.log("无缓存需要登录");
						uni.switchTab({
							url:"/pages/mypages/login"
						})
					}
			   });
		},
		onLoad() {
			//页面加载需要鉴定权限
			uni.getStorage({
			   key: 'id',
			   success: function (res) {
			      
			       
			   },
					fail:function(){
						console.log("无缓存需要登录");
						uni.switchTab({
							url:"/pages/mypages/login"
						})
					}
			   });
		}
		
	}
</script>

<style>

</style>
